package com.hzw.saas.common.flow.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzw.saas.common.flow.pojo.model.FlowProcessRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author sonam
 * @since 2021-08-04
 */
@Mapper
public interface FlowProcessRecordMapper extends BaseMapper<FlowProcessRecord> {
    @Select("<script> SELECT MAX(step) FROM tb_flow_process_record WHERE flow_instance_id=#{flowInstanceId} </script>")
    Integer getNewStep(@Param("flowInstanceId") String flowInstanceId);

    FlowProcessRecord getLatestPushOnProcess(@Param("flowInstanceId") String flowInstanceId);

}
